package com.lh.tams.service;

import org.springframework.stereotype.Service;

import com.lh.tams.dao.CaseDao;
import com.lh.tams.dao.PartyDao;
import com.lh.tams.domain.TamsCase;
import com.lh.tams.domain.TamsParty;
import com.lh.tams.util.DataGridModel;
import com.lh.tams.util.Page;

@Service
public class PartyService {
	private PartyDao partyDao;
	private CaseDao caseDao;
		
	public CaseDao getCaseDao() {
		return caseDao;
	}

	public void setCaseDao(CaseDao caseDao) {
		this.caseDao = caseDao;
	}

	public PartyDao getPartyDao() {
		return partyDao;
	}

	public void setPartyDao(PartyDao partyDao) {
		this.partyDao = partyDao;
	}

	public Page query(DataGridModel dgm,String caseNo){
		return partyDao.query(dgm, caseNo);
	}
	
	public String query(String caseNo){
		return partyDao.query(caseNo);
	}
	
	public void add(TamsParty party){
		TamsCase tamsCase = caseDao.getCaseByNo(party.getCaseNo());
		party.setTamsCase(tamsCase);
		partyDao.add(party);
	}
	
	public void update(TamsParty party){
		partyDao.update(party);;
	}
	
	public void delete(long[] ids){
		partyDao.delete(ids);
	}
}
